//
//  ZH_VedioPlayerViewController.m
//  WisdomStar
//
//  Created by zhangliwen on 2018/11/15.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "ZH_VedioPlayerViewController.h"
#import "XLVideoPlayer.h"
@interface ZH_VedioPlayerViewController ()
@property (nonatomic, strong) XLVideoPlayer *player;
@end

@implementation ZH_VedioPlayerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initUserInterface];
}
- (void)initUserInterface{
    self.navigationItem.title = @"视频播放";
    self.view.backgroundColor = [UIColor whiteColor];
    
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    self.player.videoUrl = self.mp4_url;
    [self.view addSubview:self.player];
   
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [self.player destroyPlayer];
    self.player = nil;
}

- (XLVideoPlayer *)player {
    if (!_player) {
        _player = [[XLVideoPlayer alloc] init];
         _player.frame = CGRectMake(0, 64, self.view.frame.size.width, 250);
    }
    return _player;
}
@end
